<?php
namespace app\controllers;

use app\logic\OrderLogic;
use app\logic\PayNotifyCallBack;
//前端订单接口
class OrderController extends BaseController
{
    //微信支付回调
    public function actionNotify(){
        $notify = new PayNotifyCallBack();
        $notify->Handle(false);

    }
    //提交订单
    public function actionSubmitOrder(){
        $open_id = $this->getQueryparams('open_id','');
        $course_id = $this->getQueryparams('course_id',0);
        $chapter_id = $this->getQueryparams('chapter_id',0);
        $order_type = $this->getQueryparams('order_type',0);
        $orderLogic = new OrderLogic();
        $res = $orderLogic->saveOrder($open_id,$order_type,$course_id,$chapter_id);
        if($res)
            $this->response($res);
    }

}
